﻿using System;
using System.Collections.Generic;
using System.Text;
using AbpDemo.Domain.Goods;
using AbpDemo.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Internal;

namespace AbpDemo
{
    public static class DbInitializer
    {
        public static void GoodsSeed(this AbpDemoDbContext context)
        {
            if (context.Goods.Any())
            {
                return;
            }

            var goodsSeed = new List<Domain.Goods.Goods_1>()
            {
                new Goods_1("商品1", "描述1", "规格的说明 1", 226.1m),
                new Goods_1("商品2", "描述2", "规格的说明 2", 13m),
                new Goods_1("商品3", "描述3", "规格的说明 3", 56.8m),
            };
            context.Goods.AddRange(goodsSeed);
            context.SaveChanges();
        }
    }
}
